How to get list of table names in different schema of an Oracle database
How to get list of table names in different schema of an Oracle database
20017-Jul-2023
Updated on 18-Jul-2023
Home / DeveloperSection / Forums / How to get list of table names in different schema of an Oracle database
How to get list of table names in different schema of an Oracle database
Aryan Kumar
18-Jul-2023Sure, here is how you can get the list of tables names in different schemas of an Oracle database:
SQL
This query will first select all tables from the
all_tables
view. Theall_tables
view is a data dictionary view that contains information about all of the tables in the database.The next part of the query uses the
IN
operator to check if the owner of each table in theall_tables
view is equal to one of the specified schemas. TheIN
operator takes a list of values as its argument. In this case, the list of values is the list of schemas that you want to list the tables for.If the
IN
operator returnsTRUE
for a table, then the table in theall_tables
view belongs to one of the specified schemas.The final part of the query selects the
table_name
column from theall_tables
view for all tables that belong to one of the specified schemas.To run this query, you will need to connect to the Oracle database using a tool like SQLPlus. Once you are connected, you can run the query by typing it into the SQLPlus prompt.
For example, to run the query above, you would type the following into the SQL*Plus prompt:
SQL
This would return a list of all tables in the specified schemas.